package com.cfh.ahead;

import java.io.Serializable;

import com.thoughtworks.xstream.XStream;


public class Logic implements Serializable {
	private static final long serialVersionUID = 1L;
	private LogicItem[] logics;
	private LogicItem defaultLogic;

	public static void main(String[] args) {
		Logic logic = new Logic();
		LogicItem[] items =  new LogicItem[2];
		items[0] = new LogicItem();
		items[0].setAnswer(new String[]{"Q1_1","Q2_2"});
		items[0].setType1("SX");
		items[0].setType2("YW");
		items[0].setRequire1("H");
		items[0].setRequire2("M");
		
		items[1] = new LogicItem();
		items[1].setAnswer(new String[]{"Q1_2","Q2_1"});
		items[1].setType1("SX");
		items[1].setType2("YW");
		items[1].setRequire1("H");
		items[1].setRequire2("M");
		
		LogicItem defaultlogic =  new LogicItem();
		defaultlogic.setType1("SX");
		defaultlogic.setType2("YW");
		defaultlogic.setRequire1("H");
		defaultlogic.setRequire2("M");
		
		logic.setLogics(items);
		logic.setDefaultLogic(defaultlogic);
		
		XStream xst =  new XStream();
		xst.alias("Logic", Logic.class);
		xst.alias("LogicItem", LogicItem.class);
		xst.toXML(logic, System.out);
	}


	
	public void setLogics(LogicItem[] logics) {
		this.logics = logics;
	}



	public LogicItem[] getLogics() {
		return logics;
	}



	public void setDefaultLogic(LogicItem defaultLogic) {
		this.defaultLogic = defaultLogic;
	}



	public LogicItem getDefaultLogic() {
		return defaultLogic;
	}



	
}
